rednet.open("right")

function getSignal()
	local coords = {}
	local strCoords = ""
	local id, msg, proto = rednet.receive()
	if msg == "GPS" then
		coords["x"],coords["y"],coords["z"] = gps.locate()
		strCoords = textutils.serialize(coords)
		rednet.send(id, strCoords)
	end
end

while true do
	getSignal()
	sleep(1)
end

